package com.mymvc.controller;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.servlet.ModelAndView;

/**
 * @author 王俊彪
 * @version 1.0
 */
@Controller
@RequestMapping("/product ")
public class ProductController {
//    @RequestMapping(path = "/list.do" ,method = RequestMethod.POST)
//    @PostMapping("/list.do")
    @GetMapping("/list.do")
    public ModelAndView list(){
        ModelAndView modelAndView = new ModelAndView("productList");
        modelAndView.addObject("list","从数据库查询的商品数据");
        return modelAndView;
    }
}
